<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/17
 * Time: 14:08
 */
namespace app\api\controller\v1;
use app\api\model\User as UserModel;

class User
{
    //获取用户信息
    public function read($id = 0){
        $user = UserModel::get($id);
        if($user){
            return json($user);
        }else{
//            return json(['error' => '用户不存在'], 404);
            abort(404,'用户不存在');
        }
    }

}